Data Structures

What is a Full and Perfect Binary Tree in Data Structure? | Data Structure Tutorial

What is a Full and Perfect Binary Tree in Data Structure? | Data Structure Tutorial

What is a Full and Perfect Binary Tree in Data Structure? | Data Structure Tutorial

In this article, you will understand the Full and Perfect Binary Tree in a binary tree.

What is a Full Binary Tree?

A full binary tree is a kind of binary tree in which each parent node or internal node has either two or no children. It is also known as a proper binary tree. 

The theorem of Full Binary Tree

  1. The number of leaves in the tree is i+1.
  2. The total number of nodes in the tree is 2i+1.
  3. The number of internal nodes in the tree is (n - 1)/2.
  4. The number of leaves is (n + 1)/2.
  5. The total number of nodes is 2l - 1.
  6. The number of internal nodes is (l - 1)
  7. The number of leaves is at most is 2x-1

What is a Perfect Binary Tree?

A perfect binary tree is a special kind of binary tree in which each internal node has exactly two child nodes and all the leaf nodes should be at the same level. The degree of internal nodes is 2. 

Repeatedly, A perfect binary tree can be defined as:

  • If a single node has zero children, then it is a perfect binary tree of height h=0.
  • If the height of the tree is h>0, it is perfectly binary if the height of both the subtrees is h-1 and is non-overlapping.

Theorems of Perfect Binary Tree

  1. The perfect binary tree of height h has 2h+1 -1 node.
  2. The height of the perfect binary tree with n nodes is log(n+1) - 1 = ϴ(ln(n)).
  3. The height of the perfect binary tree is 2h leaf nodes.
  4. The average depth of a node in a perfect binary tree is Ө(ln(n)).
Yamini  Sharma

I am working as a professional engineer in "HIghRadius Technologies Pvt. Ltd." Passionate about learning and exploring new technologies. Enthusiast in writing and sharing what I have in my knowledge bucket.